com.rscja.team.mtk.barcode

## Class BarcodeUtility_mtk

- java.lang.Object
- - com.rscja.team.mtk.barcode.BarcodeUtility_mtk

- All Implemented Interfaces:
    IBarcodeUtility

      public class BarcodeUtility_mtk
      extends java.lang.Object
      implements IBarcodeUtility

  条码操作类 barcode operate class 注意： Attention: 1、使用前请确认您的机器已安装键盘助手v1.9.0 之后的版本。 1. Confirm keyboardeumulator v1.9.0 has been installed before using.
  Author:
    zhoupin

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close(android.content.Context context, BarcodeUtility.ModuleType modul)` 关闭指定功能 Switch off designated function
    `void` | `closeKeyboardHelper(android.content.Context context)` 关闭键盘助手功能总开关 Switch off main function switch of keyboardemulator
    `void` | `enableContinuousScan(android.content.Context context, boolean isContinuous)` 启用连续扫描 Enable continuous scan
    `void` | `enableEnter(android.content.Context context, boolean isEnter)` 是否启用回车 Whether enable Enter function
    `void` | `enablePlayFailureSound(android.content.Context context, boolean isFailureSound)` 扫描失败是否播放提示音 whether playing notification when scanning failure.
    `void` | `enablePlaySuccessSound(android.content.Context context, boolean isSuccessSound)` 是否播放成功的提示音 whether playing notification when scanning success.
    `void` | `enableTAB(android.content.Context context, boolean isTab)` 是否启用TAB Whether enable TAB function
    `void` | `enableVibrate(android.content.Context context, boolean isVibrate)` 扫描成功是否震动提示 whether vibrating when scanning success
    `void` | `filterCharacter(android.content.Context context, java.lang.String chars)` 过滤字符串 Filter charactor string
    `static BarcodeUtility_mtk` | `getInstance()` 获取条码操作实例 Acquire barcode operation Instance.
    `void` | `getKeyboardHelperParam(android.content.Context context)`
    `void` | `interceptTrimLeft(android.content.Context context, int num)` 截取左边字符串数量 Capture left side charactor string amount
    `void` | `interceptTrimRight(android.content.Context context, int num)` 截取右边字符串数量 Capture right side charactor string amount
    `boolean` | `isPowerOn()`
    `void` | `logD(java.lang.String log)`
    `void` | `open(android.content.Context context, BarcodeUtility.ModuleType modul)` 打开指定功能 Switch on designated function
    `void` | `openKeyboardHelper(android.content.Context context)` 打开键盘助手功能总开关 Switch on main function switch of keyboardemulator
    `void` | `setBarcodeEncodingFormat(android.content.Context context, int format)` 设置条码编码格式 Setup barcode coding format
    `void` | `setContinuousScanIntervalTime(android.content.Context context, int intervalTime)` 设置连续扫描间隔时间 Setup continuous scanning duration
    `void` | `setContinuousScanTimeOut(android.content.Context context, int timeOut)` 设置连续扫描超时时间 Setup continuous scanning overtime duration
    `void` | `setOutputMode(android.content.Context context, int mode)` 设置输出模式 Setup ouput mode
    `void` | `setParam_zebra(android.content.Context context, int paramId, int paramValue)` 设置斑马扫描头参数,扫描头上电之后设置一次即可,扫描头断电之后失效。(备注：键盘助手v2.2.0.3 之后的版本才支持)
    `void` | `setPrefix(android.content.Context context, java.lang.String prefix)` 设置前缀 Setup prefix
    `void` | `setReleaseScan(android.content.Context context, boolean enable)` 松开扫描按键是否停止扫描 loose scanning button to stop scanning or not
    `void` | `setScanFailureBroadcast(android.content.Context context, boolean enable)` 扫描失败是否发送广播 Send broadcast when scanning failure.
    `void` | `setScanOutTime(android.content.Context context, int time)` 设置超时时间 Setup overtime duration
    `void` | `setScanResultBroadcast(android.content.Context context, java.lang.String broadcastAction, java.lang.String extraName)` 设置接收扫描数据的广播 Setup broad cast of received scanning data
    `void` | `setSuffix(android.content.Context context, java.lang.String suffix)` 设置后缀 Setup suffix
    `void` | `startScan(android.content.Context context, BarcodeUtility.ModuleType modul)` 开始扫描 Start scanning
    `void` | `stopScan(android.content.Context context, BarcodeUtility.ModuleType modul)` 停止扫描 Stop scanning

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static BarcodeUtility_mtk getInstance()

      获取条码操作实例 Acquire barcode operation Instance.

    - #### open

          public void open(android.content.Context context,
                           BarcodeUtility.ModuleType modul)

      打开指定功能 Switch on designated function
      Specified by:
        `open` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `modul` - 功能模块

    - #### close

          public void close(android.content.Context context,
                            BarcodeUtility.ModuleType modul)

      关闭指定功能 Switch off designated function
      Specified by:
        `close` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `modul` - 功能模块

    - #### startScan

          public void startScan(android.content.Context context,
                                BarcodeUtility.ModuleType modul)

      开始扫描 Start scanning
      Specified by:
        `startScan` in interface `IBarcodeUtility`
      Parameters:
        `modul` - 功能模块

    - #### stopScan

          public void stopScan(android.content.Context context,
                               BarcodeUtility.ModuleType modul)

      停止扫描 Stop scanning
      Specified by:
        `stopScan` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `modul` - 功能模块

    - #### setOutputMode

          public void setOutputMode(android.content.Context context,
                                    int mode)

      设置输出模式 Setup ouput mode
      Specified by:
        `setOutputMode` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `mode` - 0:扫描到光标位置(scan content to cursor) 1:剪切板(clipboard) 2:广播(broadcast) 3:模拟键盘(analog keyboard)

    - #### setScanOutTime

          public void setScanOutTime(android.content.Context context,
                                     int time)

      设置超时时间 Setup overtime duration
      Specified by:
        `setScanOutTime` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `time` - 超时时间，单位秒 time overtime time, unit is second

    - #### setScanResultBroadcast

          public void setScanResultBroadcast(android.content.Context context,
                                             java.lang.String broadcastAction,
                                             java.lang.String extraName)

      设置接收扫描数据的广播 Setup broad cast of received scanning data
      Specified by:
        `setScanResultBroadcast` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `broadcastAction` - 接收扫描数据的action
        `extraName` - Intent返回的扩展数据项目名称

    - #### openKeyboardHelper

          public void openKeyboardHelper(android.content.Context context)

      打开键盘助手功能总开关 Switch on main function switch of keyboardemulator
      Specified by:
        `openKeyboardHelper` in interface `IBarcodeUtility`
      Parameters:
        `context` -

    - #### closeKeyboardHelper

          public void closeKeyboardHelper(android.content.Context context)

      关闭键盘助手功能总开关 Switch off main function switch of keyboardemulator
      Specified by:
        `closeKeyboardHelper` in interface `IBarcodeUtility`
      Parameters:
        `context` -

    - #### enablePlaySuccessSound

          public void enablePlaySuccessSound(android.content.Context context,
                                             boolean isSuccessSound)

      是否播放成功的提示音 whether playing notification when scanning success.
      Specified by:
        `enablePlaySuccessSound` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `isSuccessSound` - true:播放成功提示音,false:不播放成功提示音 true: enable false:disable

    - #### enablePlayFailureSound

          public void enablePlayFailureSound(android.content.Context context,
                                             boolean isFailureSound)

      扫描失败是否播放提示音 whether playing notification when scanning failure.
      Specified by:
        `enablePlayFailureSound` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `isFailureSound` - true:播放失败提示音,false:不播放失败提示音 true: enable false:disable

    - #### enableVibrate

          public void enableVibrate(android.content.Context context,
                                    boolean isVibrate)

      扫描成功是否震动提示 whether vibrating when scanning success
      Specified by:
        `enableVibrate` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `isVibrate` - true:震动,false:不震动 true: enable false:disable

    - #### enableEnter

          public void enableEnter(android.content.Context context,
                                  boolean isEnter)

      是否启用回车 Whether enable Enter function
      Specified by:
        `enableEnter` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `isEnter` - true: 启用回车 false:不启用回车 true: enable false:disable

    - #### enableTAB

          public void enableTAB(android.content.Context context,
                                boolean isTab)

      是否启用TAB Whether enable TAB function
      Specified by:
        `enableTAB` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `isTab` - true: 启用回车 false:不启用回车 true: enable false:disable

    - #### setSuffix

          public void setSuffix(android.content.Context context,
                                java.lang.String suffix)

      设置后缀 Setup suffix
      Specified by:
        `setSuffix` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `suffix` - 后缀字符

    - #### setPrefix

          public void setPrefix(android.content.Context context,
                                java.lang.String prefix)

      设置前缀 Setup prefix
      Specified by:
        `setPrefix` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `prefix` - 前缀字符

    - #### interceptTrimLeft

          public void interceptTrimLeft(android.content.Context context,
                                        int num)

      截取左边字符串数量 Capture left side charactor string amount
      Specified by:
        `interceptTrimLeft` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `num` - 左边截取的字符数量

    - #### interceptTrimRight

          public void interceptTrimRight(android.content.Context context,
                                         int num)

      截取右边字符串数量 Capture right side charactor string amount
      Specified by:
        `interceptTrimRight` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `num` - 右边截取的字符数量

    - #### filterCharacter

          public void filterCharacter(android.content.Context context,
                                      java.lang.String chars)

      过滤字符串 Filter charactor string
      Specified by:
        `filterCharacter` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `chars` - 过滤的字符

    - #### setBarcodeEncodingFormat

          public void setBarcodeEncodingFormat(android.content.Context context,
                                               int format)

      设置条码编码格式 Setup barcode coding format
      Specified by:
        `setBarcodeEncodingFormat` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `format` - 0: Default 1: ASCII 2:GB2312 3:UTF8 4:Unicode 10:GBK, 11:GB18030

    - #### enableContinuousScan

          public void enableContinuousScan(android.content.Context context,
                                           boolean isContinuous)

      启用连续扫描 Enable continuous scan
      Specified by:
        `enableContinuousScan` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `isContinuous` - true: 连续扫描 false：单次扫描 true: enable false：disable

    - #### setContinuousScanIntervalTime

          public void setContinuousScanIntervalTime(android.content.Context context,
                                                    int intervalTime)

      设置连续扫描间隔时间 Setup continuous scanning duration
      Specified by:
        `setContinuousScanIntervalTime` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `intervalTime` - 间隔时间，单位毫秒 interval Time, (unit: millisecond)

    - #### setContinuousScanTimeOut

          public void setContinuousScanTimeOut(android.content.Context context,
                                               int timeOut)

      设置连续扫描超时时间 Setup continuous scanning overtime duration
      Specified by:
        `setContinuousScanTimeOut` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `timeOut` - 超时时间，单位秒 time Out(unit:second)

    - #### setScanFailureBroadcast

          public void setScanFailureBroadcast(android.content.Context context,
                                              boolean enable)

      扫描失败是否发送广播 Send broadcast when scanning failure.
      Specified by:
        `setScanFailureBroadcast` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `enable` - true:发送 false：不发送

    - #### setReleaseScan

          public void setReleaseScan(android.content.Context context,
                                     boolean enable)

      松开扫描按键是否停止扫描 loose scanning button to stop scanning or not
      Specified by:
        `setReleaseScan` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `enable` - true:停止扫描 false：不停止扫描

    - #### setParam_zebra

          public void setParam_zebra(android.content.Context context,
                                     int paramId,
                                     int paramValue)

      设置斑马扫描头参数,扫描头上电之后设置一次即可,扫描头断电之后失效。(备注：键盘助手v2.2.0.3 之后的版本才支持)
      Specified by:
        `setParam_zebra` in interface `IBarcodeUtility`
      Parameters:
        `context` -
        `paramId` - id
        `paramValue` - value

    - #### getKeyboardHelperParam

          public void getKeyboardHelperParam(android.content.Context context)

    - #### isPowerOn

          public boolean isPowerOn()

    - #### logD

          public void logD(java.lang.String log)